﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Data.Entity;
using System.Data.Entity.ModelConfiguration.Conventions;
using elibrary.Models.Entities;

namespace elibrary.Models
{
    public class DataContext : DbContext
    {
        public DbSet<User> users { get; set; }
        public DbSet<Category> categories { get; set; }
        public DbSet<Book> books { get; set; }
        public DbSet<BookCategory> bookCategories { get; set; }
        public DbSet<UserOrder> orders { get; set; }
        public DbSet<UserOrderItem> orderItems { get; set; }
        public DbSet<Payment> payments { get; set; }
        public DbSet<Notice> notices { get; set; }
        public DbSet<Feedback> feedbacks { get; set; }

        public DataContext() : base("elibrary") { }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Conventions.Remove<PluralizingTableNameConvention>();
        }
    }
}